from typing import *


class Solution:
    def mostPoints(self, questions: List[List[int]]) -> int:
        n = len(questions)
        dp = [[0] * 2 for _ in range(n)]
        for i in range(n - 1, -1, -1):
            points, brainpower = questions[i]
            dp[i][0] = 0 if i == n - 1 else max(dp[i + 1])
            dp[i][1] = points if (p := i + brainpower + 1) >= n else max(dp[p]) + points
        return max(dp[0])


a = [[0] * 5 for _ in range(5)]
a[1][1] = 10
print(a)
